﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using KerriganDirection.DirectionServiceWCF;
using System.ComponentModel;

namespace KerriganDirection.SessionMgt
{
    /// <summary>
    /// Interaction logic for ucSessionOptions.xaml
    /// </summary>
    public partial class ucSessionOptions : INotifyPropertyChanged
    {
        #region NotifyPropertyChanged

        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string property)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(property));
            }
        }

        #endregion

        #region Properties

        private MainModule _MainModuleVO;
        public MainModule MainModuleVO
        {
            get
            {
                return this._MainModuleVO;
            }
            set
            {
                this._MainModuleVO = value;
                OnPropertyChanged("MainWindowVO");
            }
        }

        #endregion

        #region Methods

        public ucSessionOptions()
        {
            InitializeComponent();

            this.MainModuleVO = (App.Current.Windows[0] as MainWindow).MainModuleVO;
        }

        #endregion

        #region Events

        private void bttAddSession_Click(object sender, RoutedEventArgs e)
        {
            this.MainModuleVO.GoToAddSession();
        }

        private void bttSaveSession_Click(object sender, RoutedEventArgs e)
        {
            this.MainModuleVO.SessionModuleVO.SetSession();
        }

        private void bttCancelSession_Click(object sender, RoutedEventArgs e)
        {
            this.MainModuleVO.GoToLitSession();
        }

        #endregion
    }
}
